Don't try and call DevController if we can't destroy a device ourselves,
authoremellor@ewan <emellor@ewan>
Wed, 12 Oct 2005 11:56:52 +0000 (12:56 +0100)
committeremellor@ewan <emellor@ewan>
Wed, 12 Oct 2005 11:56:52 +0000 (12:56 +0100)
because we are already inside the ValueError exception handler, so we know that
the give device identifier is not an integer, and DevController.destroyDevice
only accepts integers.  Fixes bug #315.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/server/blkif.py

index 5f791428bbe7b732d07232e705db222bc1f54f08..a15edf0963e2ee62b4d25fc06a7decd117ff3a1c 100644 (file)
@@ -96,6 +96,4 @@ class BlkifController(DevController):
                 if self.readBackend(i, 'dev') == devid:
                     DevController.destroyDevice(self, i)
                     return
-            # Try this, but it's almost certainly going to throw VmError,
-            # since we can't find the device.
-            DevController.destroyDevice(self, int(devid))
+            raise VmError("Device %s not connected" % devid)